<template>
  <div v-if="model&&model.modelKey=='imgBtnBox'" :key="model.modelKey" class="model_box zhubo_box">
    <div class="zhubo_box_inner" :style="`backgroundColor:${model.bgColor||''};${model.bgImage?('backgroundImage:url('+model.bgImage+');'):''}color:${model.txtColor||''}`">

      <div class="tit_box">
        <div class="tit" :style="`color:${model.titColor}`">{{ model.title }}</div>
        <div class="des" :style="`color:${model.desColor}`">{{ model.des }}</div>
      </div>
      <div class="imgbtn-cont flex" v-if="model.list&&model.list.length">
        <div v-for="(item,i) in model.list" :key="i" :style="{backgroundImage:'url('+item.img+')'}">
        </div>
      </div>
      <div v-else class="imgbtn-cont " style="height: 130px;">
        <el-empty style="margin: 15px auto;" :image-size="80" description="暂无卡片"></el-empty>
      </div>
    </div>
    <zhezhao @clickSet="clickItem('set')"></zhezhao>
  </div>
</template>

<script>
import zhezhao from "../zhezhao.vue";
export default {
  components: { zhezhao },
  props: {
    model: {
      type: Object,
      default: () => ({}),
    },
  },
  methods: {
    clickItem(type) {
      this.$emit("clickItem", { type: type, modelKey: this.model.modelKey });
    },
  },
};
</script>
<style lang="scss" scoped>
.zhubo_box {
  // padding: 0 !important;
  .zhubo_box_inner {
    padding: 6px;
    padding-bottom: 0;
    background-color: transparent;
    border-radius: 8px;
    .tit_box {
      font-weight: 600;
      font-size: 16px;
      color: #243338;
      text-align: center;
      .des{
        font-weight: 400;
        font-size: 13px;
        margin: 5px;
        margin-bottom: 8px;
        color: #37494F;
      }
    }
  }
  .imgbtn-cont {
    flex-wrap: wrap;
    div {
      width: calc(50% - 3px);
      height: 89px;
      background-size: 100% 100%;
      margin-bottom: 6px;
      &:nth-of-type(2n) {
        margin-left: 6px;
      }
    }
  }
}
</style>